﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WeiXinPF.Common;
using WeiXinPF.Templates;

namespace WeiXinPF.Web.shop
{
    /// <summary>
    /// 商品评价
    /// </summary>
    public partial class product_evaluate : ShopBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            base.OnInit(e);

            if (!string.IsNullOrEmpty(errInitTemplates))
            {
                Response.Write(errInitTemplates);
                return;
            }

            BLL.wx_userweixin bll = new BLL.wx_userweixin();
            Model.wx_userweixin wxModel = bll.GetModel(wid);

            string thisUrl = MyCommFun.getTotalUrl();

//#if Release 
//            OAuth2BaseProc(wxModel, "product_evaluate", thisUrl);
//#endif
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = Constants.MessageNoTempate;
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }

            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/product_evaluate.html";
            ShopTemplateMgr template = new ShopTemplateMgr(
                "/shop/templates/" + templateFileName, serverPath, wid);
            template.tType = TemplateType.ProductEvaluate;
            template.openid = openid;
            template.OutPutHtml(wid);
        }
    }
}